package com.xujl.mvcbind;

import android.app.Application;
import android.content.Context;

import com.xujl.fastlib.base.BaseConfig;
import com.xujl.fastlib.http.NetworkManager;
import com.xujl.fastlib.utils.ConfigManager;
import com.xujl.fastlib.utils.LogS;
import com.xujl.fastlib.utils.SpHelper;
import com.xujl.mvcbind.consts.TableName;
import com.xujl.mvcbind.util.RequestCommonParams;
import com.xujl.task.RxExecutor;

import androidx.multidex.MultiDexApplication;

/**
 * @author x
 * @Description
 */
public class App extends MultiDexApplication {
    private static Application sApplication;

    //全局点击效果配置
//    static {
//        TouchEffectsManager.build(TouchEffectsWholeType.RIPPLE)//设置全局使用哪种效果
//                .addViewType(TouchEffectsViewType.ALL)//添加哪些View支持这个效果
//                .setListWholeType(TouchEffectsWholeType.RIPPLE)//为父控件为列表的情况下，设置特定效果
//                .setAspectRatioType(4f, TouchEffectsWholeType.RIPPLE);//宽高比大于4时启动水波纹
//    }
    @Override
    public void onCreate () {
        super.onCreate();
        sApplication = this;
        LogS.init();
        //全局配置
        ConfigManager.getInstance().init(this);
        //线程池
        RxExecutor.getInstance().init();

        BaseConfig.getInstance().init(this);
        SpHelper.getInstance().init(this, TableName.SP_TABLE, Context.MODE_PRIVATE);
        //网络请求设置统一header
        NetworkManager.getInstance().setHeaders(RequestCommonParams.createParamBuilder().getHeaderMap());
    }

    public static Application getApplication () {
        return sApplication;
    }
}
